import org.junit.Ignore;
import org.junit.Test;

public class TestInterpreter {

    private String[] BuildArgs(String argLine) {
        var args = argLine.split(" ");
        args[0] = Tools.getResourcePath(args[0]);
        return args;
    }

    @Test
    public void TestT0() throws Exception {
        Interpreter.main(BuildArgs("t.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT2() throws Exception {
        Interpreter.main(BuildArgs("t2.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT3() throws Exception {
        Interpreter.main(BuildArgs("t3.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT4() throws Exception {
        Interpreter.main(BuildArgs("t4.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT5() throws Exception {
        Interpreter.main(BuildArgs("t5.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT6() throws Exception {
        Interpreter.main(BuildArgs("t6.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT7() throws Exception {
        Interpreter.main(BuildArgs("t7.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT8() throws Exception {
        Interpreter.main(BuildArgs("t8.pcode -trace -dis -dump"));
    }

    @Test
    public void TestT9() throws Exception {
        Interpreter.main(BuildArgs("t9.pcode -trace -dis -dump"));
    }

    @Test
    public void TestStruct() throws Exception {
        Interpreter.main(BuildArgs("struct.pcode -trace -dis -dump"));
    }

    @Test
    public void TestFactorial() throws Exception {
        Interpreter.main(BuildArgs("factorial.pcode -trace -dis -dump"));
    }

    @Test
    @Ignore("这个似乎是死循环")
    public void TestLoop() throws Exception {
        Interpreter.main(BuildArgs("loop.pcode -trace -dis -dump"));
    }
}
